-
-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"IsDuring" function #110
base: master
Are you sure you want to change the base?
"IsDuring" function #110
Conversation
* origin/master: Duplication issue fixed. Some multiple-ness. Test fixed. Resynced and moved some functions around #78 added functionnal option pattern for url parsing usage example, README calendar parsing url support # Conflicts: # calendar.go
Conflict resolved. |
* master: Merge remote-tracking branch 'origin/master' into issue97 Fix Some larger upgrades. Tests added. # Conflicts: # property_test.go
…Duration' due to the way time.Parse(time.RFC822Z, time.RFC822Z) works
@brackendawson Sorry for tagging you in a new (to you) PR. While this is originally for checking if some date is in between a date. -- it sprawled out a bit -- I found a major issue with the use of I think I will have to do a major version bump or something, there is a lot I'm not entirely content with having dug into timezones. I haven't read your comments yet on #107 I've run out of time today. But I should get some time on Wednesday AEST but a quick glance slightly suggests to me that they might be related. Let me know your thoughts |
If my proposal were adopted for #99/#107, having a configurable fallback time-zone scoped to the // Contains returns true if the given time falls within the event. Within is
// defined as equal to or after the start and before the end.
func (c *ComponentBase) Contains(t time.Time) (bool, error) {
end, err := e.GetStartAt()
if err != nil {
if errors.Is(err, ErrorPropertyNotFound) {
return false, nil
}
return false, err
}
if t.Before(start) {
return false, nil
}
end, err := e.GetEndAt()
if err != nil {
if errors.Is(err, ErrorPropertyNotFound) {
return false, nil
}
return false, err
}
if t.After(end) || t.Equal(end) {
return false, nil
}
return true, nil
} Go will handle the time zones for you. |
I will have to produce some sort of https://github.com/golang/go/blob/master/src/time/time.go#L140-L161 I just pray the timezone information is isomorphic when I get around to that. In terms of the other components of the PR opinion? |
The closest the spec goes to "global timezone" is: https://www.rfc-editor.org/rfc/rfc5545
Which is per component. Also note, TZ can be custom specified. Which means I need to parse and understand RRULE. But I'm not sure how to convert that to Heh amusing: |
Pending merge with #99 for resolution
Fixes: #70
As requested.
This is broken and will need to be manually merged with:
#107
In order to fix the outstanding issues with it.
Please review Mereep @Mereep And let me know if it is what you had in mind, there are some
TODO
I added as I need your input on in order to complete this, this isn't functionality I have used.Someone could also add aggregate / filtering functions to this to help people get "all the matching events" etc.